package com.wingsfrog.travel.modules.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by rankin on 16/3/30.
 */
@Entity
@Table(name = "t_hint", schema = "", catalog = "travel")
public class Hint {
    private int id;
    private int taskId;
    private String hintName;
    private String hintContent;
    private int hintType;
    private int hintLevel;
    private Timestamp createdAt;
    private Timestamp updatedAt;
    private String createBy;
    private String updateBy;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "task_id")
    public int getTaskId() {
        return taskId;
    }

    public void setTaskId(int taskId) {
        this.taskId = taskId;
    }

    @Basic
    @Column(name = "hint_name")
    public String getHintName() {
        return hintName;
    }

    public void setHintName(String hintName) {
        this.hintName = hintName;
    }

    @Basic
    @Column(name = "hint_content")
    public String getHintContent() {
        return hintContent;
    }

    public void setHintContent(String hintContent) {
        this.hintContent = hintContent;
    }

    @Basic
    @Column(name = "hint_type")
    public int getHintType() {
        return hintType;
    }

    public void setHintType(int hintType) {
        this.hintType = hintType;
    }

    @Basic
    @Column(name = "hint_level")
    public int getHintLevel() {
        return hintLevel;
    }

    public void setHintLevel(int hintLevel) {
        this.hintLevel = hintLevel;
    }

    @Basic
    @Column(name = "created_at")
    public Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    @Basic
    @Column(name = "updated_at")
    public Timestamp getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Timestamp updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Basic
    @Column(name = "create_by")
    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    @Basic
    @Column(name = "update_by")
    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Hint hint = (Hint) o;

        if (id != hint.id) return false;
        if (taskId != hint.taskId) return false;
        if (hintType != hint.hintType) return false;
        if (hintLevel != hint.hintLevel) return false;
        if (hintName != null ? !hintName.equals(hint.hintName) : hint.hintName != null) return false;
        if (hintContent != null ? !hintContent.equals(hint.hintContent) : hint.hintContent != null) return false;
        if (createdAt != null ? !createdAt.equals(hint.createdAt) : hint.createdAt != null) return false;
        if (updatedAt != null ? !updatedAt.equals(hint.updatedAt) : hint.updatedAt != null) return false;
        if (createBy != null ? !createBy.equals(hint.createBy) : hint.createBy != null) return false;
        if (updateBy != null ? !updateBy.equals(hint.updateBy) : hint.updateBy != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + taskId;
        result = 31 * result + (hintName != null ? hintName.hashCode() : 0);
        result = 31 * result + (hintContent != null ? hintContent.hashCode() : 0);
        result = 31 * result + hintType;
        result = 31 * result + hintLevel;
        result = 31 * result + (createdAt != null ? createdAt.hashCode() : 0);
        result = 31 * result + (updatedAt != null ? updatedAt.hashCode() : 0);
        result = 31 * result + (createBy != null ? createBy.hashCode() : 0);
        result = 31 * result + (updateBy != null ? updateBy.hashCode() : 0);
        return result;
    }
}
